Carbon


MPSetTaskWeight

Header: Multiprocessing.h Carbon status: Modified

Assigns a relative weight to a task, indicating how much processor time it should receive compared to other available tasks.

OSStatus MPSetTaskWeight (
    MPTaskID task, 
    MPTaskWeight weight
);
task

The ID of the task to which you want to assign a weighting.

weight

The relative weight to assign. This value can range from 1 to 10,000, with the default value being 100.

function result

A result code.

DISCUSSION

The approximate processor share is defined as

weight of the task/ total weight of available tasks

For a set of ready tasks, the amount of CPU time dedicated to the tasks will be determined by the dynamically computed share. Note that the processor share devoted to tasks may deviate from the suggested weighting if critical tasks require attention. For example, a real-time task (such as a QuickTime movie) may require more than its relative weight of processor time, and the scheduler will adjust proportions accordingly.

VERSION NOTES

Introduced with Multiprocessing Services 2.0.

AVAILABILITY

Modified in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 2.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 2.0 and later.

CARBON NOTES

MPSetTaskWeight will set task priorities on Mac OS X.


© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)